package com.music.entity;

/**
 * 购物车类
 * 
 * @author Administrator
 *
 */
public class ShoppingCart {
	/**
	 * 购物车id
	 */
	private int id;

	/**
	 * 用户
	 */
	private User user;

	/**
	 * 唱片
	 */
	private Album album;

	/**
	 * 订单数量
	 */
	private int quantity;

	/**
	 * 小计
	 */
	private double subtotal;

	public double getSubtotal() {
		subtotal = quantity * album.getPrice();
		return subtotal;
	}

	public void setSubtotal(double subtotal) {
		this.subtotal = subtotal;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Album getAlbum() {
		return album;
	}

	public void setAlbum(Album album) {
		this.album = album;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public ShoppingCart(int id, User user, Album album, int quantity) {
		super();
		this.id = id;
		this.user = user;
		this.album = album;
		this.quantity = quantity;
	}

	public ShoppingCart() {
		super();
	}

}
